package com.noah.bee.admin.constant;

/**
 * @author wuzhen
 * @since 16/12/19 15:32
 */

public enum TabDefinition {
    /**********注意：除Introduction外，各枚举的名字和zk中节点名称保持一致*********/
    Introduction(0, "使用说明", "introduction"),
    jobApp(1, "jobApp", "settings"),
    pay(2, "pay", "settings"),
    insurance(3, "insurance", "settings"),
    cooperation(4, "cooperation", "settings"),
    stock(5, "stock", "settings"),
    econtract(6, "econtract", "settings"),
    settle(7, "settle", "settings"),
    fund(8, "fund", "settings"),
    databiz(9, "databiz", "settings"),
    app(10, "app", "settings"),
    message(11, "message", "settings"),
    hsapp(5, "hsapp", "settings");

    private int code;

    private String name;

    private String viewName;

    TabDefinition(int code, String name, String viewName) {
        this.code = code;
        this.name = name;
        this.viewName = viewName;
    }

    public int getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public String getViewName() {
        return viewName;
    }

    public static TabDefinition getTabDefinition(int code) {
        for (TabDefinition definition : TabDefinition.values()) {
            if (code == definition.getCode()) return definition;
        }
        return null;
    }
}
